1. The Theory of Keyboard Customization with KCHRs
2. Creating or Modifying KCHRs
3. Installing KCHRs
4. The Sample KCHRs
5. Apple’s “Keyboard” Control Panel Device
6. Keyboard Switcher
6.1 Normal Operation
6.2 The Keyboard Switcher cdev
6.3 Compatibility Notes
7. The Switcher FKEY
1. The Theory of Keyboard Customization with KCHRs
------------------------------------------------
When you type a keystroke (a normal key, plus perhaps some modifier keys like Shift and Option), the Macintosh system software creates a keyboard event. The keystroke is translated into a character using a special translation table called a KCHR resource. When the system software is “localized” for a particular language, a suitable KCHR is designed. Users can also use KCHRs to personalize their keyboard layout.
Certain keystrokes called “dead keys” modify the succeeding character instead of typing anything themselves. For example, in the standard U.S. KCHR, Option-e is one of 5 dead keys. If you type Option-e alone, nothing happens immediately. But if you then type, say, an e, you will get an e with an acute accent.
Each “script”, or writing system, owns a certain range of resource ID numbers for KCHRs. A KCHR belonging to the Roman script (which is used for most European languages) should have a resource ID in the range 0 to 16383. The standard U.S. KCHR is number 0.
Each KCHR has a corresponding small icon (SICN) resource with the same resource ID. The standard U.S. KCHR's SICN is a black diamond. U.S. users do not normally see this icon, but some foreign systems display it in the menu bar. Clicking on it switches scripts. This was the inspiration for Keyboard Switcher.
2. Creating or Modifying KCHRs
----------------------------
You can modify or create KCHR (and SICN) resources using ResEdit, a free utility from Apple. You can probably figure out how to do so by trial and error. However, documentation on ResEdit, and on editing KCHRs in particular, can be found in the book “ResEdit Reference”, published by Addison-Wesley, and in an upcoming ResEdit book by BMUG. The KCHR article in the BMUG book was written by Yours Truly.
Do not attempt to use ResEdit on a file while it is held open by Suitcase II or MasterJuggler. Do not use attempt to switch KCHRs while a KCHR file is open in ResEdit.
3. Installing KCHRs
------------------
A KCHR resource (and its SICN) can be installed directly into the System file using ResEdit or ResCopy, or a file containing KCHRs can be opened with Suitcase II or MasterJuggler. I have given the “sample KCHRs” file the file type of a font file, so that Suitcase II or MasterJuggler can open it without special maneuvers.
Make sure that you do not have more than one KCHR with the same ID number. As explained above, the number should normally be between 1 and 16383.
4. The Sample KCHRs
-------------------
Several sample KCHR resources, with SICNs, are provided with Keyboard Switcher. These include:
Dvorak: The Dvorak keyboard layout is reputed to allow more efficient typing of English text than the standard “QWERTY” layout. I have provided a “quick and dirty” Dvorak KCHR in which only shifted and unshifted characters have been rearranged. In particular, keystrokes using the Command modifier have not been modified.
If you want a more carefully-designed Dvorak KCHR, you might consider the KCHR which comes with “Electric Dvorak”, a postcard-ware utility by Tom Phoenix.
US Undead: This is the standard U.S. KCHR with the dead keys removed. You could use this if, for example, you have an uncontrollable urge to assign a QuicKeys macro to Option-e. (It is not possible to assign QuicKeys macros to dead keys.)
No Capslock: This KCHR disables the Capslock modifier key. This is for those who frequently hit Caplslock by accident, and rarely hit it on purpose.
Shift Cancels Capslock: With this KCHR, you can keep the Capslock key down, but use the Shift key to type occasional lowercase letters.
U.S. with ., modified: In this KCHR, the period and comma keys are unmodified by Shift. But if you do want to type < or >, you can use Shift-Option.
5. Apple’s “Keyboard” Control Panel Device
---------------------------------------
If you have more than one KCHR installed, then Keyboard will show you a scrolling list of the KCHRs. Clicking on a member of this list will make it the active KCHR, and also the startup KCHR.
6. Keyboard Switcher
--------------------
Keyboard Switcher is an INIT/cdev which makes it easy to use more than one KCHR.
6.1 Normal Operation
Keyboard Switcher puts the SICN (small icon) representing the active KCHR into the menu bar. Clicking on this icon makes the next available KCHR the active KCHR, without changing the startup KCHR. If the new KCHR belongs to a different script, as indicated by its resource ID, then Keyboard Switcher will change scripts accordingly.
Option-clicking on the icon drops a menu of the available KCHRs, so you can choose one by name. The active KCHR is indicated with a check-mark.
If you have more than one script system installed (say, Roman and Arabic), then Command-clicking on the icon will switch scripts. Otherwise, command-clicking does nothing.
6.2 The Keyboard Switcher cdev
With the Control Panel, you can perform some less common operations with Keyboard Switcher. You should see approximately the following.
The middle section shows the names of the active and startup KCHRs. By clicking the “Set” button, you can reset the startup KCHR to be the same as the active KCHR. Note that doing so modifies your System file. Therefore it may annoy some virus-protection programs, and will not work if your System file is locked.
In the lower section, you can control whether Keyboard Switcher’s icon will appear in the menu bar, and if so, where. Using the scroll bar, you can move the icon anywhere along the scroll bar. You’ll want to move it somewhere that it will not interfere with normal menus or with MultiFinder’s application icon. I like to put it at the extreme left, to the left of the Apple menu.
By clicking the “Click for menu” check-box, you can interchange the meaning of clicking and option-clicking on Keyboard Switcher’s icon. The “Show startup icon” check-box which determines whether Keyboard Switcher will show its icon during startup.
6.3 Compatibility Notes
Keyboard Switcher has been tested primarily with System 6.0.7, MultiFinder, and Suitcase II. I have also tested it with MasterJuggler.
I have not been able to test Keyboard Switcher with A/UX or with System 7.0b1.
Startup Manager, part of Now Utilities 2.0, issues a deceptive error message if you activate it at startup and your startup KCHR is installed with Suitcase II or MasterJuggler. It says that Startup Manager, the System file, or your disk may be damaged. Actually, it is just upset that it cannot find the startup KCHR. This will probably be corrected in a later version of Now Utilities.
7. The Switcher FKEY
-------------------
In case you don’t want Keyboard Switcher to put an icon in your menu bar, I have provided an FKEY for switching KCHRs. It can be installed using ResEdit, Suitcase II, or specialized FKEY management programs. The disadvantage is that the FKEY provides no visual feedback.